package org.linlinjava.litemall.wx.web;

import lombok.extern.slf4j.Slf4j;
import org.linlinjava.litemall.core.util.ResponseUtil;
import org.linlinjava.litemall.db.domain.VendorCategory;
import org.linlinjava.litemall.db.service.VendorCategoryService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * 商户类别
 */
@Slf4j
@RestController
@RequestMapping("/wx/category")
@Validated
public class WxCateGoryController {

    @Autowired
    private VendorCategoryService categoryService;

    @GetMapping("/listAll")
    public Object listAll() {
        List<VendorCategory> tagList = categoryService.queryAllCategories(null, null);
        return ResponseUtil.okList(tagList);
    }
}